package hsl.study.controller;


import jakarta.annotation.Resource;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: hsl
 * @CreateDate: 2025/7/31 14:05
 * @Version: 1.0
 */

@RestController
@RequestMapping("/multiModels")
public class MultiModelsController {

    @Resource(name = "deepseek")
    private OpenAiChatModel deepseek;

    @Resource(name = "qwenPlus")
    private OpenAiChatModel qwenPlus;

    @GetMapping("/chat1")
    public String chat(@RequestParam(name = "question",defaultValue = "你是谁") String question)
    {
        String result = deepseek.call(question);
        System.out.println("deepseek result:" + result);
        return result;
    }

    @GetMapping("/chat2")
    public String chat2(@RequestParam(name = "question",defaultValue = "你是谁") String question)
    {
        String result = qwenPlus.call(question);
        System.out.println("qwen result:" + result);
        return result;
    }
}
